<script type="text/javascript" src="<?php echo base_url()?>js/admins/jquery-latest.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>js/admins/jquery.tablesorter.js"></script>
<script type="text/javascript">
	$(function() {		
		$("#myTable").tablesorter({sortList:[[0,0],[2,1]]});
	});	
</script>
<div id="content-right">
	<div id="add-product">
		<div id="sidebar-list" class="black">
			<div id="img-product" class="left white">
				 <?php echo $title?>
			</div>
			<div id="img-back" class="right">
				<a href="javascript:;" onclick="history.go(-1)" class="white">Quay lại trang trước </a>
			</div>
			<div class="clear"></div>
		</div>
		<?php if (isset($_SESSION["permiss_error"]) && !empty($_SESSION["permiss_error"])){?>
			<div class="form-add" align="center" style="padding-bottom:15px;">
				<?php echo '<font style="color:red; text-align:center; font-size:15px;">'.$_SESSION['permiss_error'].'</font>'?>
			</div>
        <?php }$_SESSION["permiss_error"] = NULL;?>
		<form name="myform" id="myform" action="<?php echo base_url() ?>admins/admin_group/delete" method="POST" onSubmit="return checkInput(this,'Bạn hãy chọn ít nhất một group admin','Bạn có chắc muốn xóa không?');">
			<input type="hidden" id="chon" name="chon">
			<div id="select-product">
				<ul class="left">
					<li><a href="<?php echo base_url()?>admins/admin_group/add">Thêm mới </a></li>
					<li>|</li>
					<li><a href="#"><span id="chk">0</span> đã chọn</a></li>
					<li>|</li>
					<li><input style="background-color: none; border: none; text-decoration: underline; color: #EF3503; font-family: Arial; cursor: pointer;" type="submit" name="cmd" value="Xóa"></li>
				</ul>
				<div class='clear'></div>
			</div>
			<div id="list-product">
				<table id="myTable" class="tablePr tablesorter" width="100%" border="0" cellspacing="0" cellpadding="0">
					<thead>
						<tr class="headerTbl">
							<td width="5%">STT</td>
							<td width="5%"><input id="checkall" type="checkbox" name="chkall" value="yes" onClick="docheck(this.form,0);" /></td>
							<th width="15%">Administrator Group</th>
							<th width="15%">Phân Quyền</th>
							<td width="10%">Xử Lý</td>
						</tr>
					</thead>
					<?php if (!empty($admin_group)){?>
						<tbody>
							<?php
								$i = 1; 
								foreach ($admin_group as $index) {
									if ($i % 2 == 0)
									{
										$bgcolor	= 'str1';
									}
									else
									{
										$bgcolor	= 'str2';
									}
							?>
							<tr class="<?php echo $bgcolor?>">
								<td><?php echo $i;?></td>
								<td><input type="checkbox" name="Xoa" value="<?php echo $index['id']?>" onClick="docheckone(this.form);"/></td>
								<td><?php echo $index['name']?></td>
								<td>
									<?php if ($_SESSION['admin_id'] == 1 || $_SESSION['admin_id'] == 12){?>
										<a style="color: #EF3505; text-decoration: underline;" href="<?php echo base_url()?>admins/admin_group/permiss/<?php echo $index['id']?>/<?php echo $index['name']?>">Phân Quyền</a>
									<?php  }else{ echo 'No Permission';}?>
								</td>
								<td>
									<a href="<?php echo base_url()?>admins/admin_group/edit/<?php echo $index['id']?>"><img width="16" height="16" src="<?php echo base_url()?>images/back_end/icon/edit-icon.png" title="Sửa admin group: <?php echo $index['name']?>" /></a>
									<a onclick="return confirm('Bạn có chắc chắn xóa: <?php echo $index['name']?> ?');" href="<?php echo base_url()?>admins/admin_group/del/<?php echo $index['id']?>"><img width="16" height="16" src="<?php echo base_url()?>images/back_end/icon/icon_del.gif" title="Xóa admin group: <?php echo $index['name']?>" /></a>&nbsp;
									<a href="<?php echo base_url()?>admins/admin_group/active/<?php echo $index['id']?>/<?php echo $index['status']?>">
										<?php if ($index['status'] == 1){?>
											<img src="<?php echo base_url()?>images/back_end/icon/Check-icon.png" alt="checked" title="Ẩn" />
										<?php } else {?>
											<img src="<?php echo base_url()?>images/back_end/icon/un-check.png" alt="check" title="Hiển thị" />
										<?php }?>
									</a>
								</td>
							</tr>
							<?php $i++;}?>
						</tbody>
					<?php }else{?>
						<tr><td colspan="5" style="padding: 15px;">Không có dữ liệu</td></tr>
					<?php }?>
				</table>
			</div>
		</form>
	</div>
</div><!-- end  content-right -->	